<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	{include="style"}
	<style>
		.cache-s{
			width:6rem !important;
		}
		.layui-form-label{
			width:100px;
		}
		.layui-input-block{
			margin-left:150px;
		}
	</style>
</head>
<body>
<div class="x-body layui-anim layui-anim-up">
	<div class="layui-card">
		<div class="layui-card-body">
			<blockquote class="layui-elem-quote">{if($webconf['iswap']==1)}{fun JZLANG('手机端已开启，sitemap将包含手机端URL，请注意【手机静态目录')}-[ {$webconf['mobile_html']} ]】{if($webconf['mobile_html']!='/')}，{fun JZLANG('如果不生成静态文件，请改为')}[ / ]{/if}{else}{fun JZLANG('手机端未开启，sitemap不会包含手机端URL')}{/if}<br/>
				{fun JZLANG('PC端网站地图：')}sitemap.xml<br/>
				{fun JZLANG('手机端网站地图：')}mobile_sitemap.xml<br/>
				如果是txt类型文件，则生成如下文件：<br/>
				{fun JZLANG('PC端网站地图：')}sitemap.txt<br/>
				{fun JZLANG('手机端网站地图：')}mobile_sitemap.txt<br/>

			</blockquote>
			<fieldset class="layui-elem-field">
				<legend>{fun JZLANG('网站地图')}</legend>
				<div class="layui-field-box">
					<div class="layui-col-md12">
						<form class="layui-form " action="">

							<table class="layui-table">
								<tr>
									<th>{fun JZLANG('模块名称')}</th>
									<th>{fun JZLANG('更新频率')}</th>
									<th>{fun JZLANG('站内权重')}</th>
									<th>{fun JZLANG('输出范围')}</th>

								</tr>
								<tr>
									<td>{fun JZLANG('栏目模块')}<input name="model[]" value="classtype" type="hidden"></td>
									<td><select name="freq[]"  >
										<option value="always">经常(always)</option>
										<option value="hourly">每时(hourly)</option>
										<option value="daily">每天(daily)</option>
										<option value="weekly">每周(weekly)</option>
										<option value="monthly">每月(monthly)</option>
										<option value="yearly">每年(yearly)</option>

									</select>
									</td>
									<td><input name="priority[]" type="number" class="layui-input" value="0.90"></td>
									<td><select name="isshow[]"  >
										<option value="1">{fun JZLANG('显示的栏目')}</option>
										<option value="2">{fun JZLANG('所有的栏目')}</option>
									</select>
										<button onclick="del(this)"  class="layui-btn  layui-btn-danger" type="button">{fun JZLANG('删除')}</button>
									</td>
								</tr>
								<tr>
									<td>{fun JZLANG('文章模块')}<input name="model[]" value="article" type="hidden"></td>
									<td><select name="freq[]"  >
										<option value="always">经常(always)</option>
										<option value="hourly">每时(hourly)</option>
										<option value="daily">每天(daily)</option>
										<option value="weekly">每周(weekly)</option>
										<option value="monthly">每月(monthly)</option>
										<option value="yearly">每年(yearly)</option>

									</select>
									</td>
									<td><input name="priority[]" type="number" class="layui-input" value="0.80"></td>
									<td><select name="isshow[]"  >
										<option value="1">{fun JZLANG('显示的文章')}</option>
										<option value="2">{fun JZLANG('所有的文章')}</option>
									</select>
										<button onclick="del(this)"  class="layui-btn  layui-btn-danger" type="button">{fun JZLANG('删除')}</button>
									</td>
								</tr>
								<tr>
									<td>{fun JZLANG('商品模块')}<input name="model[]" value="product" type="hidden"></td>
									<td><select name="freq[]"  >
										<option value="always">经常(always)</option>
										<option value="hourly">每时(hourly)</option>
										<option value="daily">每天(daily)</option>
										<option value="weekly">每周(weekly)</option>
										<option value="monthly">每月(monthly)</option>
										<option value="yearly">每年(yearly)</option>

									</select>
									</td>
									<td><input name="priority[]" type="number" class="layui-input" value="0.80"></td>
									<td><select name="isshow[]"  >
										<option value="1">{fun JZLANG('显示的商品')}</option>
										<option value="2">{fun JZLANG('所有的商品')}</option>
									</select>
										<button onclick="del(this)"  class="layui-btn  layui-btn-danger" type="button">{fun JZLANG('删除')}</button>
									</td>
								</tr>

								{loop table="molds" sys="0" ismust="1" as="v"}
								<tr>
									<td>{$v['name']}{fun JZLANG('模块')}<input name="model[]" value="{$v['biaoshi']}" type="hidden"></td>
									<td><select name="freq[]"  >
										<option value="always">经常(always)</option>
										<option value="hourly">每时(hourly)</option>
										<option value="daily">每天(daily)</option>
										<option value="weekly">每周(weekly)</option>
										<option value="monthly">每月(monthly)</option>
										<option value="yearly">每年(yearly)</option>

									</select>
									</td>
									<td><input name="priority[]" type="number" class="layui-input" value="0.80"></td>
									<td><select name="isshow[]"  >
										<option value="1">{fun JZLANG('显示的')}{$v['name']}</option>
										<option value="2">{fun JZLANG('所有的')}{$v['name']}</option>
									</select>
										<button onclick="del(this)"  class="layui-btn  layui-btn-danger" type="button">{fun JZLANG('删除')}</button>
									</td>
								</tr>
								{/loop}
								<tr>
									<td>TAGS{fun JZLANG('模块')}<input name="model[]" value="tags" type="hidden"></td>
									<td><select name="freq[]"  >
										<option value="always">经常(always)</option>
										<option value="hourly">每时(hourly)</option>
										<option value="daily">每天(daily)</option>
										<option value="weekly">每周(weekly)</option>
										<option value="monthly">每月(monthly)</option>
										<option value="yearly">每年(yearly)</option>

									</select>
									</td>
									<td><input name="priority[]" type="number" class="layui-input" value="0.80"></td>
									<td><select name="isshow[]"  >
										<option value="1">{fun JZLANG('显示的')}</option>
										<option value="2">{fun JZLANG('所有的')}</option>
									</select>
										<button onclick="del(this)"  class="layui-btn  layui-btn-danger" type="button">{fun JZLANG('删除')}</button>
									</td>
								</tr>


							</table>


							<div class="layui-form-item">
								<label for="page_size" class="layui-form-label">
									<span class="x-red">*</span>{fun JZLANG('每页链接数')}
								</label>
								<div class="layui-input-inline">
									<input name="page_size" value="{$sitemap_conf['page_size']}" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label for="filetype" class="layui-form-label">
									<span class="x-red">*</span>{fun JZLANG('TAGS链接类型')}
								</label>
								<div class="layui-input-inline">
									<input name="tagsurl" value="{$sitemap_conf['tagsurl']}" class="layui-input">
								</div>
								<div class="layui-form-mid layui-word-aux">
									{id}，{keywords}自动替换变量，链接必须 / 开头，否则出错
								</div>
							</div>
							<div class="layui-form-item">
								<label for="filetype" class="layui-form-label">
									<span class="x-red">*</span>{fun JZLANG('生成文件类型')}
								</label>
								<div class="layui-input-inline">
									<select name="filetype"  >
										<option value="xml" {if($sitemap_conf['filetype']=='xml')}selected{/if}>xml</option>
										<option value="txt" {if($sitemap_conf['filetype']=='txt')}selected{/if}>txt</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item">
								<div class="layui-input-block">
									<button class="layui-btn" lay-submit lay-filter="formDemo">{fun JZLANG('立即生成')}</button>

								</div>
							</div>
						</form>
					</div>
				</div>
			</fieldset>
		</div>
	</div>

</div>
<script>
	layui.use(['laydate','form','layer','upload'], function(){
		$ = layui.jquery;
		var form = layui.form
			,layer = layui.layer;
		laydate = layui.laydate;
		var upload = layui.upload;
		//监听提交
		form.on('submit(formDemo)', function(data){
			//console.log(data.field);return false;
			$.post("{fun U('Index/sitemap')}",data.field,function(r){
				//console.log(r);return false;
				var r = JSON.parse(r);
				if(r.code!=1){

					layer.msg(r.msg,{icon:6},function(){
						window.location.reload();
					})
					

				}else{
					layer.alert(r.msg, {icon: 5});
				}
			});


			return false;
		});
	})
	function del(a){
		$(a).parent().parent().remove();
	}
</script>
</body>
</html>